﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Core;
using Utilities;
using System.Data;
using Data.Controllers;

namespace Data.DBOES
{

    [TableAttribute("Membership")]
    [Serializable]
 public  class Membership:DBO<Membership>
    {
        #region Fields

        private int? _IdMembership;
        [ColumnAttribute("IdMembership", SqlDbType.Int, 4, true, true, false)]
        public int? IdMembership
        {
            get { return _IdMembership; }
            set { _IdMembership = value; }
        }
        private string _MembershipName;
        [ColumnAttribute("MembershipName", SqlDbType.NVarChar, 300, false, false, true)]
        public string MembershipName
        {
            get { return _MembershipName; }
            set { _MembershipName = value; }
        }
        private DateTime? _Birthday;
        [ColumnAttribute("Birthday", SqlDbType.DateTime, 8, false, false, true)]
        public DateTime? Birthday
        {
            get { return _Birthday; }
            set { _Birthday = value; }
        }
        private string _Email;
        [ColumnAttribute("Email", SqlDbType.NVarChar, 50, false, false, true)]
        public string Email
        {
            get { return _Email; }
            set { _Email = value; }
        }
        private string _Phone;
        [ColumnAttribute("Phone", SqlDbType.NVarChar, 50, false, false, true)]
        public string Phone
        {
            get { return _Phone; }
            set { _Phone = value; }
        }
        private string _Address;
        [ColumnAttribute("Address", SqlDbType.NVarChar, 300, false, false, true)]
        public string Address
        {
            get { return _Address; }
            set { _Address = value; }
        }
        private string _UserName;
        [ColumnAttribute("UserName", SqlDbType.NVarChar, 50, false, false, true)]
        public string UserName
        {
            get { return _UserName; }
            set { _UserName = value; }
        }
        private string _Password;
        [ColumnAttribute("Password", SqlDbType.NVarChar, 50, false, false, true)]
        public string Password
        {
            get { return _Password; }
            set { _Password = value; }
        }
        private int? _IdRole;
        [ColumnAttribute("IdRole", SqlDbType.Int, 4, false, false, true)]
        public int? IdRole
        {
            get { return _IdRole; }
            set { _IdRole = value; }
        }
        private Boolean? _IsHelpOnline;
        [ColumnAttribute("IsHelpOnline", SqlDbType.Bit, 1, false, false, true)]
        public Boolean? IsHelpOnline
        {
            get { return _IsHelpOnline; }
            set { _IsHelpOnline = value; }
        }
        private Boolean? _IsSpecial;
        [ColumnAttribute("IsSpecial", SqlDbType.Bit, 1, false, false, true)]
        public Boolean? IsSpecial
        {
            get { return _IsSpecial; }
            set { _IsSpecial = value; }
        }
        private Boolean? _IsActive;
        [ColumnAttribute("IsActive", SqlDbType.Bit, 1, false, false, true)]
        public Boolean? IsActive
        {
            get { return _IsActive; }
            set { _IsActive = value; }
        }
        private Boolean? _IsLogin;
        [ColumnAttribute("IsLogin", SqlDbType.Bit, 1, false, false, true)]
        public Boolean? IsLogin
        {
            get { return _IsLogin; }
            set { _IsLogin = value; }
        }
        private DateTime? _CreateDate;
        [ColumnAttribute("CreateDate", SqlDbType.DateTime, 8, false, false, true)]
        public DateTime? CreateDate
        {
            get { return _CreateDate; }
            set { _CreateDate = value; }
        }
        private int? _IdLanguage;
        [ColumnAttribute("IdLanguage", SqlDbType.Int, 4, false, false, true)]
        public int? IdLanguage
        {
            get { return _IdLanguage; }
            set { _IdLanguage = value; }
        }
        private int? _IdCategoryHelpOnlineType;
        [ColumnAttribute("IdCategoryHelpOnlineType", SqlDbType.Int, 4, false, false, true)]
        public int? IdCategoryHelpOnlineType
        {
            get { return _IdCategoryHelpOnlineType; }
            set { _IdCategoryHelpOnlineType = value; }
        }
        /// <summary>
        /// Get a Newse of current Comment object base on IdNews
        /// </summary>
        public Role role
        {
            get
            {
                if (this.IdRole == null)
                    return null;

                Role condition = new Role(this.IdRole);
                condition.IdLanguage = this.IdLanguage;
                return RoleController.FindItem(condition);
            }
        }
		


        #endregion
        #region Constructors
       public Membership()
       { 
       
       }
       public Membership(int? IdMembership)
       {
           this.IdMembership = IdMembership;
       }
       public Membership(string Username)
       {
           this.UserName = Username;
       }
       public Membership(Boolean? IsLogin)
       {
           this.IsLogin = IsLogin;
       }
       public Membership(int? IdMebership, string MebershipName, DateTime? Birthday, string Email, string Phone, string Address, string UserName, string Password, int? IdRole, Boolean? IsHelpOnline, Boolean? IsSpecial, Boolean? IsActive, Boolean? IsLogin, DateTime? CreateDate, int? IdLanguage, int? IdCategoryHelpOnlineType)
       { 
            this.IdMembership=IdMembership;
            this.MembershipName=MembershipName;
            this.Birthday=Birthday;
            this.Email=Email;
            this.Phone=Phone;
            this.Address=Address;
            this.UserName=UserName;
            this.Password=Password;
            this.IdRole=IdRole;
            this.IsHelpOnline=IsHelpOnline;
            this.IsSpecial=IsSpecial;
            this.IsActive=IsActive;
            this.IsLogin=IsLogin;
            this.CreateDate=CreateDate;
            this.IdLanguage=IdLanguage;
            this.IdCategoryHelpOnlineType = IdCategoryHelpOnlineType;

       }
        #endregion
       
    }
}
